<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h1>JavaScript Example 14</h1>
<br>
Instantiating and Using a Custom Object.
<br>
<hr>
<br>

<!-- SCRIPT STARTS HERE -->

<script type="text/javascript">
	// create object
	var student = new Object();
	// get/set properties using object style syntax
	student.firstName = "John";
	document.write(student.firstName);
	
	// get/set properties using array style syntax
	student["name"] = "Smith";
	document.write(" "+student["name"]);
	
	// mix both approaches (set object style, get array style)
	student.age = 20;
	document.write(" (" + student["age"] + " years)");
</script>


<!-- SCRIPT ENDS HERE -->

</body>
</html>
